<?php
namespace app\admin\controller;
use think\Db;//导入数据库类 (DB类)
use think\Session;
use think\Request;
use think\Controller;
class Person extends Admin
{
    public function index()
    {
        $data = db('admin')->where('id',input('session.admin.id'))->find();

        $this->assign('data',$data);
        return view('AdminPerson/AdminPerson');
    }
    // 编辑个人信息
    public function edi()
    {
        $data = db('admin')->where('id',input('session.admin.id'))->find();
        $this->assign('data',$data);
        return view('AdminPerson/edit');
    }
    // 执行编辑
    public function edit()
    {
        if(Request::instance()->isPost()){
            if(db('admin')->where('id',input('session.admin.id'))->update(input())){
                return $this->success('修改成功','index');
            }else{
                return $this->error('修改失败');
            }
            
        }
    }
}